// app/(evcp)/admin/permissions/settings/page.tsx

"use client";

import { useState } from "react";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
import { Button } from "@/components/ui/button";
import { Shield, Key, Settings, RefreshCw } from "lucide-react";
import { PermissionCrudManager } from "@/components/permissions/permission-crud-manager";
import { MenuBasedPermissionGenerator } from "@/components/permissions/menu-permission-generator";
import { PermissionGroupManager } from "@/components/permissions/permission-group-manager";

export default function PermissionSettingsPage() {
  return (
    <div className="container mx-auto p-6">
      <div className="mb-6">
        <h1 className="text-3xl font-bold mb-2">권한 설정</h1>
        <p className="text-muted-foreground">
          시스템 권한을 생성, 수정, 삭제하고 메뉴 기반으로 권한을 자동 생성합니다.
        </p>
      </div>

      <Tabs defaultValue="permissions" className="space-y-4">
        <TabsList>
          <TabsTrigger value="permissions">
            <Key className="mr-2 h-4 w-4" />
            권한 관리
          </TabsTrigger>
          <TabsTrigger value="generate">
            <RefreshCw className="mr-2 h-4 w-4" />
            메뉴 기반 생성
          </TabsTrigger>
          <TabsTrigger value="groups">
            <Shield className="mr-2 h-4 w-4" />
            권한 그룹
          </TabsTrigger>
        </TabsList>

        <TabsContent value="permissions">
          <PermissionCrudManager />
        </TabsContent>

        <TabsContent value="generate">
          <MenuBasedPermissionGenerator />
        </TabsContent>

        <TabsContent value="groups">
          <PermissionGroupManager />
        </TabsContent>
      </Tabs>
    </div>
  );
}